The open source RFortran library for accessing R from Fortran, with applications in environmental modelling

نویسندگان

  • Mark Thyer
  • Michael Leonard
  • Dmitri Kavetski
  • Stephen Need
  • Benjamin Renard
چکیده

The open source RFortran library is introduced as a convenient tool for accessing the functionality and packages of the R programming language from Fortran programs. It significantly enhances Fortran programming by providing a set of easy-to-use functions that enable access to R's very rapidly growing statistical, numerical and visualization capabilities, and support a richer and more interactive model development, debugging and analysis setup. RFortran differs from current approaches that require calling Fortran DLLs from R, and instead enables the Fortran program to transfer data to/from R and invoke R-based procedures via the R command interpreter. More generally, RFortran obviates the need to reorganize Fortran code into DLLs callable from R, or to rewrite existing R packages in Fortran, or to jointly compile their Fortran code with the R language itself. Code snippets illustrate the basic transfer of data and commands to and from R using RFortran, while two case studies discuss its advantages and limitations in realistic environmental modelling applications. These case studies include the generation of automated and interactive inference diagnostics in hydrological calibration, and the integration of R statistical packages into a Fortran-based numerical quadrature code for joint probability analysis of coastal flooding using numerical hydraulic models. Currently, RFortran uses the Component Object Model (COM) interface for data/command transfer and is supported on the Microsoft Windows operating system and the Intel and Compaq Visual Fortran compilers. Extending its support to other operating systems and compilers is planned for the future. We hope that RFortran expedites method and software development for scientists and engineers with primary programming expertise in Fortran, but who wish to take advantage of R's extensive statistical, mathematical and visualization packages by calling them from their Fortran code. Further information can be found at The Fortran programming language is well established within the scientific and engineering communities because of its computational speed, mathematical support and memory efficiency. Considerable Fortran-based code has been developed over the last 40 years and it remains widely used in contemporary scientific and engineering software. In particular, many environmental models are written in Fortran, including the Australian Community Climate and Earth-System Since its now-dated 1977 standard, Fortran has undergone major revisions in 1990 and 2003, extending its parallel computing capabilities, array handling and introducing elements of object-oriented programming. However, Fortran has notoriously limited support for visualization and interoperability with other languages and applications (though Fortran-2003 implements interoperability with C). Often, Fortran users …

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Connectivity Modeling System: A probabilistic modeling tool for the multi-scale tracking of biotic and abiotic variability in the ocean

Pelagic organisms’ movement and motion of buoyant particles are driven by processes operating across multiple, spatial and temporal scales. We developed a probabilistic, multi-scale model, the Connectivity Modeling System (CMS), to gain a mechanistic understanding of dispersion and migration processes in the ocean. The model couples offline a new nested-grid technique to a stochastic Lagrangian...

متن کامل

An open source massively parallel solver for Richards equation: Mechanistic modelling of water fluxes at the watershed scale

In this paper we present a massively parallel open source solver for Richards equation, named the RichardsFOAM solver. This solver has been developed in the framework of the open source generalist computational fluid dynamics tool box OpenFOAM ® and is capable to deal with large scale problems in both space and time. The source code for RichardsFOAM may be downloaded from the CPC program librar...

متن کامل

The Effects of Sound on the Marine Environment

Concern has increased about the role of man-made noise in the marine environment. To address this, ONR has supported the development of the Effects of Sound on the Marine Environment (ESME) workbench. The initial Graphical User Interface was developed by NRL using Matlab with calls to FORTRAN implementations of acoustic propagation models. The acoustic modeling tools are mostly drawn from ONR’s...

متن کامل

OOFɛ: A Python engine for automating regional and coastal ocean forecasts

Coastal and regional ocean forecasts can be currently performed on a daily basis due to the advances in numerical techniques and in computational resources. Maintenance of routine forecasts is a demanding task from the point of view of software engineering since it involves a number of new additional tasks difficult to code efficiently in the compiled languages in which ocean models are written...

متن کامل

Development of a nitrous oxide routine for the SWAT model to assess greenhouse gas emissions from agroecosystems

Greenhouse gas (GHG) emissions from agroecosystems, particularly nitrous oxide (N2O), are an increasing concern. To quantify N2O emissions from agroecosystems, which occur as a result of nitrogen (N) cycling, a new physically-based routine was developed for the Soil and Water Assessment Tool (SWAT) model to predict N2O flux during denitrification and an existing nitrification routine was modifi...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Environmental Modelling and Software

دوره 26  شماره 

صفحات  -

تاریخ انتشار 2011